﻿using System;

namespace ProjectEuler
{
    internal class Problem9
    {
        public void Solve()
        {
            var prod = FindProd();
            Console.WriteLine("problem 9: " + prod);
        }

        int FindProd()
        {
            for (int c = 998; c > 2; c--)
            {
                for (int b = 1000 - c - 1; b > 1; b--)
                {
                    var a = 1000 - c - b;
                    if (a * a + b * b - c * c == 0)
                    {
                        return a * b * c;
                    }
                }
            }

            return 0;
        }
    }
}